<?php
/**
 * Created by PhpStorm.
 * User: qhzhyt
 * Date: 2018/10/6
 * Time: 17:50
 */

require_once '../conf/conf.php';

$map_path = '../files/upload/map/map_100000_d3050951b5540f5b.json';
if (isset($_GET['mapId'])) {
    $map = $db->get('map', '*', ['map_id' => $_GET['mapId']]);
    if ($map) {
        $map_path = '../files/upload/map/map_' . $_GET['mapId'] . '_' . substr($map['map_hash'], 16) . '.json';
    }
}

if (!file_exists($map_path)) {
    $map_path = '../files/upload/map/map_100000_d3050951b5540f5b.json';
}

echo file_get_contents($map_path);
